Add a css style test for :first/last/only-child
authorMatthias Clasen <mclasen@redhat.com>
Mon, 28 Dec 2015 18:59:10 +0000 (13:59 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 3 Jan 2016 14:19:31 +0000 (09:19 -0500)
testsuite/css/style/Makefile.am
testsuite/css/style/nth-child.css [new file with mode: 0644]
testsuite/css/style/nth-child.nodes [new file with mode: 0644]
testsuite/css/style/nth-child.ui [new file with mode: 0644]

index db48f79358134058f060bd07ca951817d781b8b3..a7d1e99e1b9013b8d2f341c73abcfd194c2343eb 100644 (file)
@@ -26,6 +26,7 @@ test_css_style_SOURCES = \
 
 test_data = \
        label.ui        label.css       label.nodes \
+       nth-child.ui    nth-child.css   nth-child.nodes \
        $(NULL)
 
 EXTRA_DIST += $(test_in_files) $(test_data)
diff --git a/testsuite/css/style/nth-child.css b/testsuite/css/style/nth-child.css
new file mode 100644 (file)
index 0000000..96265b2
--- /dev/null
@@ -0,0 +1,14 @@
+@import "reset-to-defaults.css";
+
+label:first-child {
+  font-size: 20px;
+}
+label {
+  font-size: 30px;
+}
+label:last-child {
+  font-size: 40px;
+}
+label:only-child {
+  font-size: 50px;
+}
diff --git a/testsuite/css/style/nth-child.nodes b/testsuite/css/style/nth-child.nodes
new file mode 100644 (file)
index 0000000..55c70d8
--- /dev/null
@@ -0,0 +1,13 @@
+window visible=0 state=dir-ltr classes=background
+  decoration visible=1 state=dir-ltr
+  box visible=1 state=dir-ltr classes=horizontal
+    box visible=1 state=dir-ltr classes=horizontal
+      label visible=1 state=dir-ltr
+        font-size: 20px (nth-child.css:4:17)
+      label visible=1 state=dir-ltr
+        font-size: 30px (nth-child.css:7:17)
+      label visible=1 state=dir-ltr
+        font-size: 40px (nth-child.css:10:17)
+    box visible=1 state=dir-ltr classes=horizontal
+      label visible=1 state=dir-ltr
+        font-size: 50px (nth-child.css:13:17)
diff --git a/testsuite/css/style/nth-child.ui b/testsuite/css/style/nth-child.ui
new file mode 100644 (file)
index 0000000..b0b6765
--- /dev/null
@@ -0,0 +1,48 @@
+
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkWindow" id="window1">
+    <property name="can_focus">False</property>
+    <property name="type">popup</property>
+    <child>
+      <object class="GtkBox">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkBox">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Hello World!</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Hello World!</property>
+              </object>
+            </child>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Hello World!</property>
+              </object>
+            </child>
+          </object>
+        </child>
+        <child>
+          <object class="GtkBox">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Hello World!</property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>